#ifndef LVGLVIRTUALSCREEN_H
#define LVGLVIRTUALSCREEN_H
#include <QPainter>
#include <QPaintEvent>
#include <QWidget>
#include <QImage>
#include <QTimer>
#include <QMouseEvent>
#include "lvglthread.h"

class LvglVirtualScreen : public QWidget
{
    Q_OBJECT
private:
    int x;
    int y;
    bool mousePressFlag;
    uchar *vRam;
    int virtualScreenW;
    int virtualScreenH;
    LvglThread *workThread;
protected:
    void paintEvent(QPaintEvent *event);
    void mousePressEvent(QMouseEvent *event);
    void mouseReleaseEvent(QMouseEvent *event);
    void mouseMoveEvent(QMouseEvent *event);
public:
    LvglVirtualScreen(int w, int h, uchar *ram = nullptr, QWidget *parent = nullptr);
    ~LvglVirtualScreen();
    uchar *getVRam();
    void getMousePos(int16_t &x, int16_t &y);
    bool getMousePressFlag();
};

extern LvglVirtualScreen *thisAppWindow;
#endif
